package com.jy.api.signUpReq;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2018/7/31.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PayTotalRes {

    private double wx = 0.0;

    private double ali = 0.0;

    private double cash = 0.0;

    private double total;

    public PayTotalRes(Double wx, Double ali, Double cash) {
        this.wx = wx;
        this.ali = ali;
        this.cash = cash;

    }

    public double getTotal(PayTotalRes payTotalRes) {
        BigDecimal p1 = new BigDecimal(Double.toString(payTotalRes.getWx()));
        BigDecimal p2 = new BigDecimal(Double.toString(payTotalRes.getAli()));
        BigDecimal p3 = new BigDecimal(Double.toString(payTotalRes.getCash()));
        this.total =p1.add(p2).add(p3).doubleValue();
        return total;
    }


}
